<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Booking First-Car Rental</title>
<script>
function onLoad(){
document.forms[0].submit();
}

</script>
</head>
<body onload="onLoad();">
<h4>I am heading to raiffeisen...</h4>
<h3>Please wait...:)</h3>

<?php
$order = $_POST["fromBank"];
$desc = $_POST["desc"];
?>
<?php
$MerchantID = '1754257';
$TerminalID = 'E7882257';
$OrderID = $order;
$PurchaseTime = date("ymdHis") ;
$TotalAmount = 1500;
$CurrencyID = 978;
$data = "$MerchantID;$TerminalID;$PurchaseTime;$OrderID;$CurrencyID;$TotalAmount;;";


$fp = fopen("http://booking.first.al/raiffeisen/1754257.pem", "r");
$priv_key = fread($fp, 8192);
fclose($fp);
$pkeyid = openssl_get_privatekey($priv_key);
openssl_sign( $data , $signature, $pkeyid);
//openssl_free_key($pkeyid);
$b64sign = base64_encode($signature);
?>

<form id="raiffeisen" action="https://secure.upc.ua/ecgtestsq/enter" method="post" >
   <input name="Version" type="hidden" value="1" />
   <input name="MerchantID" type="hidden" value="<?php echo $MerchantID?>" />
   <input name="TerminalID" type="hidden" value="<?php echo $TerminalID?>" />
   <input name="TotalAmount" type="hidden" value="<?php echo $TotalAmount?>" />
   <input name="Currency" type="hidden" value="<?php echo $CurrencyID?>" />
   <input name="locale" type="hidden" value="al" />
   <input name="PurchaseTime" type="hidden" value="<?php echo $PurchaseTime ?>" />
   <input name="OrderID" type="hidden" value="<?php echo $OrderID?>" />
   <input name="PurchaseDesc" type="hidden" value="<?php echo $desc?>" />
   <input type="hidden"  name="Signature" id="out" value="<?php echo $b64sign ?>">
 
</form>

</body>
</html>
